<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
	 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
  <head>
    <base href="<%=basePath%>"/>
    
    <title>厦大植物检索与交流系统</title>
	<meta http-equiv="pragma" content="no-cache"/>
	<meta http-equiv="cache-control" content="no-cache"/>
	<meta http-equiv="expires" content="0"/>    
	<meta http-equiv="keywords" content="厦大,植物检索,"/>
	<meta http-equiv="description" content="厦大植物检索与交流系统"/>
	<link rel="stylesheet" type="text/css" href="css/common.css"/>
	<link rel="stylesheet" type="text/css" href="css/jquery.ui.all.css"/>
	<link rel="stylesheet" type="text/css" href="css/addfeature.css"/>
	<link rel="stylesheet" type="text/css" href="css/jquery-ui-1.7.3.custom.css"/>
	<script type="text/javascript" language="javascript" src="js/jquery-1.7.1.js"></script>
	<script type="text/javascript" language="javascript" src="js/jquery.dropdown.js"></script>
	<script type="text/javascript" language="javascript" src="js/jquery.ui.core.js"></script>
	<script type="text/javascript" language="javascript" src="js/jquery.ui.widget.js"></script>
	<script type="text/javascript" language="javascript" src="js/jquery.ui.mouse.js"></script>
	<script type="text/javascript" language="javascript" src="js/jquery.ui.slider.js"></script>
	<script type="text/javascript" language="javascript" src="js/jquery.ui.button.js"></script>
	<script type="text/javascript" language="javascript" src="retrieval/addfeature.js"></script>
	<script>
	$(function() {
		$( "input:submit", "body" ).button();
	});
	</script>
  </head>
  
  <body>
<div id="wrapper">
	<div id="logo">
		<h1><a href="index.html">厦大植物检索与交流平台</a></h1>
	</div>
	<hr />
	<!-- end #logo -->
	<div id="header">
		<% 
			Integer userId = (Integer)request.getSession().getAttribute("userId");
			Integer role = (Integer)request.getSession().getAttribute("role");
		%>
		<div id="menu">
			<ul class="dropdown">
				<li><a href="index.html">首页</a>
				</li>
				<li><a>植物检索</a>
					<ul class="sub_menu">
     				   <li><a href="plantManager-showSubject.html">专题库查找</a></li>
   					   <li><a href="plantManager-kindList.html?move=0&page.currentPage=1&keOrShu=1">分等级检索</a></li>
        			   <li><a href="retrieval-toMultichannel.html">多通道检索</a></li>
					   <li><a href="plantManager-mapSearch.html">地图植物定位</a></li>
					</ul>
				</li>
   				<% if(userId != null && userId > 0 ){ %>
				<li><a>植物信息管理</a>
					<ul class="sub_menu">
     				   <li><a href="plantManager-toAddPlant.html">新增植物</a></li>
   					   <li><a href="plantManager-toAddSubject.html">新增专题</a></li>
   					    <% if( role != null && role == 3){ %>
   					   <li><a href="plant-listKindKe.html">分类管理</a></li>
   					   <%} %>
					</ul>
				</li>
   				<%} %>
				<li><a>个人植物库</a>
					<ul class="sub_menu">
   					   <% if(userId != null && userId > 0 ){ %>
        			   <li><a href="system-tomodifypwd.html">修改密码</a></li>
     				   <li><a href="user-showUserInfo.html">查看个人信息</a></li>
 				       <li><a href="user-toModifyUserInfo.html">修改个人信息</a></li>
 				       <% if(userId != null && userId > 0 && role != null && role == 3){ %>
 				       <li><a href="user-userlist.html">用户管理</a></li>
 				        <%} %>
 				       <li><a href="logout.html">退出</a></li>
 				       <%}else{ %>
     				   <li><a href="system-toLogin.html?isIntercepted=1">登录</a></li>
   					   <li><a href="system-registerinfo.html">注册</a></li>
 				        <%} %>
					</ul>
				</li>
				<li><a href="forum.html">论坛</a>
				</li>
			</ul>
		</div>
		<!-- end #menu -->
	</div>
	<!-- end #header -->
	<div id="page">
		<div id="content">
			<div id="title"></div>
			<div id="addfeature">
				<form action="retrieval-addFeature.html" method="post">
					<s:iterator value="features" id="f1" status="st1">
						<div class="first">
							<h2>${ f1.levelName}</h2>
						</div>
						<s:iterator value="%{#f1.children}" id="f2" status="st2">
							<s:if test="#f2.isLastLevel == 1">
								<div class="second">
									<input type="checkbox" name="checkbox" value="<s:property value='#f2.idLevel'/>" class="featurecheck" />
									<input type="hidden" value="<s:property value='#f2.idLevel'/>" name="featureId"/>
									<label class="flable">
										<h3> ${f2.levelName }</h3>
									</label>
									<div class="fimportant">
										<h4>性状重要性</h4>
									</div>
									<div id="slider<s:property value='#st1.index'/><s:property value='#st2.index'/>" class="slider">
										<input class="gradeshow" name="grade" type="text" onFocus="this.blur()" readonly="readonly" id="amount<s:property value='#st1.index'/><s:property value='#st2.index'/>" value="<s:property value='#f2.grade'/>"/>
									</div>
								<script>
									$(function() {
										$("#slider<s:property value='#st1.index'/><s:property value='#st2.index'/>").slider( {
											range : "min",
											value : <s:property value='#f2.grade'/>,
											min : 1,
											max : 100,
											animate : true,
											slide : function(event, ui) {
											$("#amount<s:property value='#st1.index'/><s:property value='#st2.index'/>").val(ui.value);
											}
										});
									});
								</script>
								</div>
								<!-- end #second -->
							</s:if>
								
							<s:else>
								<div class="second"><h3>${f2.levelName }</h3></div>
									<s:iterator value="%{#f2.children}" id="f3" status="st3">
										<s:if test="#f3.isLastLevel == 1">
										<div class="third">
											<input type="checkbox" name="checkbox" value="<s:property value='#f3.idLevel'/>" class="featurecheck" />
											<input type="hidden" value="<s:property value='#f3.idLevel'/>" name="featureId"/>
											<label class="flable" >
												<h3>
													${f3.levelName }
												</h3>
											</label>
											<div class="fimportant">
												<h4>
													性状重要性
												</h4>
											</div>
											<div id="slider<s:property value='#st1.index'/><s:property value='#st2.index'/><s:property value='#st3.index'/>" class="slider">
											<input type="text" name="grade" class="gradeshow" onFocus="this.blur()" readonly="readonly" id="amount<s:property value='#st1.index'/><s:property value='#st2.index'/><s:property value='#st3.index'/>" value="<s:property value='#f3.grade'/>"/>
										</div>
										<script>
											$(function() {
												$("#slider<s:property value='#st1.index'/><s:property value='#st2.index'/><s:property value='#st3.index'/>").slider( {
													range : "min",
													value : <s:property value='#f3.grade'/>,
													min : 1,
													max : 100,
													animate : true,
													slide : function(event, ui) {
														$("#amount<s:property value='#st1.index'/><s:property value='#st2.index'/><s:property value='#st3.index'/>").val(ui.value);
													}
												});
											});
										</script>
										</div>
										</s:if>
										<s:else>
											<div class="third"><h4>${f3.levelName }</h4></div>
											<s:iterator value="%{#f3.children}" id="f4" status="st4">
												<s:if test="#f4.isLastLevel == 1">
													<div class="fourth">
														<input type="checkbox" name="checkbox" value="<s:property value='#f4.idLevel'/>"
															class="featurecheck" />
														<input type="hidden" value="<s:property value='#f4.idLevel'/>" name="featureId"/>
														<label class="flable">
														<h3>${f4.levelName }</h3>
														</label>
											<div class="fimportant">
												<h4>
													性状重要性
												</h4>
											</div>
										<div id="slider<s:property value='#st1.index'/><s:property value='#st2.index'/><s:property value='#st3.index'/><s:property value='#st4.index'/>" class="slider">
											<input type="text" name="grade" class="gradeshow" onFocus="this.blur()" readonly="readonly" id="amount<s:property value='#st1.index'/><s:property value='#st2.index'/><s:property value='#st3.index'/><s:property value='#st4.index'/>" value="<s:property value='#f4.grade'/>"/>
										</div>
										<script>
											$(function() {
												$("#slider<s:property value='#st1.index'/><s:property value='#st2.index'/><s:property value='#st3.index'/><s:property value='#st4.index'/>").slider( {
													range : "min",
													value : <s:property value='#f4.grade'/>,
													min : 1,
													max : 100,
													animate : true,
													slide : function(event, ui) {
														$("#amount<s:property value='#st1.index'/><s:property value='#st2.index'/><s:property value='#st3.index'/><s:property value='#st4.index'/>").val(ui.value);
													}
												});
											});
										</script>
										</div>
												</s:if>
												<s:else>
													<div class="fourth"><h4>${f4.levelName }</h4></div>
													<s:iterator value="%{#f4.children}" id="f5" status="st5">
														<div class="fifth">
														<input type="checkbox" name="checkbox" value="<s:property value='#f4.idLevel'/>"
															class="featurecheck" />
														<input type="hidden" value="<s:property value='#f5.idLevel'/>" name="featureId"/>
														<label class="flable">
														<h3>${f5.levelName }</h3>
														</label>
											<div class="fimportant">
												<h4>
													性状重要性
												</h4>
											</div>
										<div id="slider<s:property value='#st1.index'/><s:property value='#st2.index'/><s:property value='#st3.index'/><s:property value='#st4.index'/><s:property value='#st5.index'/>" class="slider">
											<input type="text" name="grade" class="gradeshow" onFocus="this.blur()" readonly="readonly" id="amount<s:property value='#st1.index'/><s:property value='#st2.index'/><s:property value='#st3.index'/><s:property value='#st4.index'/><s:property value='#st5.index'/>" value="<s:property value='#f5.grade'/>"/>
										</div>
										<script>
											$(function() {
												$("#slider<s:property value='#st1.index'/><s:property value='#st2.index'/><s:property value='#st3.index'/><s:property value='#st4.index'/><s:property value='#st5.index'/>").slider( {
													range : "min",
													value : <s:property value='#f5.grade'/>,
													min : 1,
													max : 100,
													animate : true,
													slide : function(event, ui) {
														$("#amount<s:property value='#st1.index'/><s:property value='#st2.index'/><s:property value='#st3.index'/><s:property value='#st4.index'/><s:property value='#st5.index'/>").val(ui.value);
													}
												});
											});
										</script>
										</div>
													</s:iterator>
												</s:else>
											</s:iterator>
										</s:else>
										</s:iterator>
									</s:else>
						</s:iterator>
					</s:iterator>
					<div id="empty"></div>
					<input type="hidden" value="<s:property value='plantId'/>" name="plantId"/>
					<input type="submit" value="完成" id="addsubmit">
				</form>
			</div>
			<!-- end #addfeature -->
		</div>
		<!-- end #content -->
		<div style="clear: both;">&nbsp;</div>
	</div>
	<!-- end #page -->
	<div id="footer">
		<p>
		<a href="index.html">返回首页</a>|
            Copyright &copy; 2012 厦门大学软件学院</p>
	</div>
	<!-- end #footer -->
</div>
</body>
</html>
